Skip to content

[18.0][MIG] connector_extension: Migration to 18.0#663

Merged
eantones merged 65 commits into18.0from
18.0-mig-connector_extension
Mar 31, 2026
Merged

[18.0][MIG] connector_extension: Migration to 18.0#663
eantones merged 65 commits into18.0from
18.0-mig-connector_extension

Conversation

@deeniiz
Copy link
Copy Markdown
Collaborator

@deeniiz deeniiz commented Sep 9, 2025

No description provided.

@deeniiz deeniiz requested a review from eantones September 9, 2025 15:30
Copilot AI review requested due to automatic review settings October 14, 2025 16:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates the connector_extension module from a previous version to Odoo 18.0, bringing all necessary files and components into the new version while maintaining the existing functionality of extending the base connector framework.

  • Migration of all core connector extension components including models, components, and configuration files
  • Addition of comprehensive documentation files (README, description, contributors)
  • Implementation of enhanced connector framework with binders, mappers, importers, exporters, and adapters

Reviewed Changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
connector_extension/manifest.py Module manifest defining dependencies and metadata for version 18.0
connector_extension/init.py Main module initialization importing components and models
connector_extension/models/ Core models including backend and binding abstractions
connector_extension/components/ Framework components for adapters, binders, mappers, importers, and exporters
connector_extension/common/tools.py Utility functions for data processing and transformations
connector_extension/readme/ Documentation files describing the module functionality
connector_extension/static/description/index.html Generated HTML documentation for the module
connector_extension/pyproject.toml Build system configuration
connector_extension/README.rst Main documentation file

framework by providing new classes, methods, and utilities for easier
integration with third-party systems.
- Reusable components: Pre-built components for handling common tasks
such error handling, and data synchronization.
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling: missing 'as' after 'such'

Suggested change
such error handling, and data synchronization.
such as error handling, and data synchronization.

Copilot uses AI. Check for mistakes.
def _after_export(self, binding):
"""Can do several actions after exporting a record on the backend"""

#TODO: Review
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO comment should be more specific about what needs to be reviewed or should be resolved before production.

Suggested change
#TODO: Review
# TODO: Ensure that record._table is always a trusted value to prevent SQL injection.

Copilot uses AI. Check for mistakes.
return mapped


# TODO: create a fix on OCA repo and remove this class
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO comment should include more details about what fix is needed and provide a timeline or tracking information.

Suggested change
# TODO: create a fix on OCA repo and remove this class
# TODO: Remove this class once upstream support is added in OCA/base_export_mapper.
# See https://github.com/OCA/connector/issues/XXX (replace XXX with actual issue number).
# This class is a temporary workaround for missing functionality in OCA/base_export_mapper.
# Target: Remove by Q4 2024 or when the referenced issue is resolved.

Copilot uses AI. Check for mistakes.
Comment on lines +568 to +571
# TODO: naming the methods more intuitively
# TODO: unify both methods, they have a lot of common code
# TODO: extract parts to smaller and common methods reused by the main methods
# TODO: use .new instead of dicts on to_binding_from_internal_key
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple TODO comments at the end of the file indicate incomplete refactoring work. These should be addressed or converted to proper issues with tracking.

Suggested change
# TODO: naming the methods more intuitively
# TODO: unify both methods, they have a lot of common code
# TODO: extract parts to smaller and common methods reused by the main methods
# TODO: use .new instead of dicts on to_binding_from_internal_key

Copilot uses AI. Check for mistakes.
string="Languages",
)

# TODO: REVIEW: Create a template view to be inherited
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO comment should be more specific about what template view needs to be created and why.

Suggested change
# TODO: REVIEW: Create a template view to be inherited
# TODO: Create a generic form view (template) for 'connector.extension.backend' to be inherited by other modules.
# This will allow extension modules to customize or extend the backend configuration UI as needed.

Copilot uses AI. Check for mistakes.
Comment on lines +111 to +112
# TODO: create a new decorator to write the field mapping manually
# I think this is not necessary, just use changed_by is precisely for that
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO comment indicates uncertainty about implementation approach. This should be resolved with a clear decision.

Suggested change
# TODO: create a new decorator to write the field mapping manually
# I think this is not necessary, just use changed_by is precisely for that

Copilot uses AI. Check for mistakes.
binding=self.model,
ignore_required_fields=True,
)
# TODO: check if we can put this in a hook
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO comment should specify what kind of hook is needed and provide more context for the refactoring.

Suggested change
# TODO: check if we can put this in a hook
# TODO: Consider refactoring the external_alt_id assignment to a dedicated pre-processing hook.
# This would allow customization of how alternative external IDs are generated before binding.
# Evaluate if a hook (e.g., 'prepare_external_alt_id') should be introduced for extensibility.

Copilot uses AI. Check for mistakes.
Comment on lines +58 to +60
def _filter(self, values, domain=None): # noqa: C901
# TODO support for domains with 'or' clauses
# TODO refactor and optimize
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method has a complexity warning (C901) and TODO comments indicating it needs refactoring. This should be addressed to improve maintainability.

Copilot uses AI. Check for mistakes.
@deeniiz deeniiz force-pushed the 18.0-mig-connector_extension branch from 1f47c84 to 70844dd Compare October 15, 2025 09:17
@github-actions
Copy link
Copy Markdown

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale label Feb 15, 2026
@eantones eantones added no stale and removed stale labels Feb 15, 2026
@deeniiz deeniiz force-pushed the 18.0-mig-connector_extension branch from 030469e to dfdaa5a Compare March 11, 2026 16:55
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 29.76480% with 866 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (18.0@4b294fd). Learn more about missing BASE report.

Files with missing lines Patch % Lines
connector_extension/components/binder.py 17.98% 228 Missing ⚠️
connector_extension/components/adapter.py 12.69% 165 Missing ⚠️
connector_extension/components/mapper.py 23.73% 151 Missing ⚠️
connector_extension/components/importer.py 35.32% 119 Missing ⚠️
connector_extension/components/exporter.py 36.13% 76 Missing ⚠️
connector_extension/models/binding/binding.py 29.76% 59 Missing ⚠️
connector_extension/models/backend/backend.py 50.76% 32 Missing ⚠️
connector_extension/models/base.py 25.00% 15 Missing ⚠️
connector_extension/components/export_deleter.py 69.69% 10 Missing ⚠️
connector_extension/components/import_deleter.py 79.31% 6 Missing ⚠️
... and 1 more
Additional details and impacted files
@@           Coverage Diff           @@
##             18.0     #663   +/-   ##
=======================================
  Coverage        ?   29.76%           
=======================================
  Files           ?       17           
  Lines           ?     1233           
  Branches        ?      252           
=======================================
  Hits            ?      367           
  Misses          ?      866           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@deeniiz deeniiz force-pushed the 18.0-mig-connector_extension branch 2 times, most recently from 6a75dcd to 9a96bd0 Compare March 31, 2026 14:14
KNVx and others added 27 commits March 31, 2026 16:48
…_binding_from_internal_key. Included relation on _get_external_record_domain
…ter problems on wrap. Find better way to do it
…rator atomic created to lock relation to do the _run logic in a different transaction"

This reverts commit 83304b7.
…ternal object after odoo unlink and base unlink
… dependencies once even when dependencies has binding
@deeniiz deeniiz force-pushed the 18.0-mig-connector_extension branch from 9a96bd0 to a59a839 Compare March 31, 2026 15:10
@eantones eantones merged commit e028182 into 18.0 Mar 31, 2026
13 checks passed
@eantones eantones deleted the 18.0-mig-connector_extension branch March 31, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants